import styles from "@styles/search.module.less";
import React from "react";
import SuggestionItem from "@pages/search/widgets/suggestionItem";

export interface SuggestionType {
  // 经过处理之后的联想建议关键词(高亮)
  name: string;
  // 原始的联想建议关键词
  origin: string;
}

interface Props {
  suggestions: SuggestionType[];
}

export default function Suggestion({ suggestions }: Props) {
  return (
    <ul className={styles.suggest}>
      {suggestions.map((item, index) => (
        <SuggestionItem key={index} suggestion={item} />
      ))}
    </ul>
  );
}
